package com.zr.bili.controller;

import com.zr.bili.entity.User;
import com.zr.bili.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhangrui
 * @date 2020-04-11 22:32
 */
@RequestMapping("user")
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/list/all")
    public List<User> listAll() {
        return userService.listAll();
    }

    @PostMapping("/inser/one")
    public int insertUser(User user){
        return userService.insertService(user);
    }
}
